<?php
namespace Admin\Model;

use Think\Model;

class StyleModel extends Model
{

    public function getAll()
    {
        $styles = $this->select();
        return $styles;
    }

    public function getStyle($list)
    {
        foreach ($list as $key => $value) {
            $where = 'id=' . $value['style_id'];
            $list[$key]['style_id'] = $this->where($where)->find()['name'];
        }
        return $list;
    }
    public function create($data){
        $res=$this->add($data);
        return $res;
    }
    public function finded($where){
        $list=$this->where($where)->find();
        return $list;
    }
    public function deleted($where){
        $res=$this->where($where)->delete();
        return $res;
    }


    public function update($where,$data){
        $res=$this->where($where)->save($data);
        return $res;
    }
}